﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Collections;
using GPCSC.Web;
using NickLee.Web.UI;
using NickLee.Common;

namespace GPCSC.Web
{
    public partial class top : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                buildtopMenu();

            }
        }
        protected void buildtopMenu()
        {
            //权限控制
            byte[] userInfo = (byte[])base.o_baseTable[c_obj.s_userInfo];
            Hashtable userInfoTable = CompressData.UnCompressHashtable(userInfo);
            Model.CL_Menu_S[] UserMenus = (Model.CL_Menu_S[])userInfoTable["SYS_UserMenu"];
            Model.CL_USER_S users = (Model.CL_USER_S)userInfoTable["SYS_USER"];
            this.Label1.Text = users.REALNAME.ToString();
           // this.Label2.Text = DateTime.Now.Year.ToString() + "年" + DateTime.Now.Month.ToString() + "月" + DateTime.Now.Day + "日";
            this.labti.InnerText = DateTime.Now.ToString();
            Model.CL_ROLE_S UserRole = (Model.CL_ROLE_S)userInfoTable["SYS_userRole"];
            mrsy.Value = UserRole.MRSY.ToString();
            
            //int index = 0;
            //string menus = "";
            //for (int i = 0; i < UserMenus.Length; i++)
            //{
            //    Model.CL_Menu_S UserMenu = new Model.CL_Menu_S();
            //    UserMenu = UserMenus[i];
            //    string menuid = UserMenu.CL_Menu_SOID.ToString();
            //    string menuname = UserMenu.MenuName.ToString();
            //    //int menudepth = UserMenu.DEPTH;
                
            //    if (UserMenu.CL_PARMenuID_PK.ToString() == "00000000-0000-0000-0000-000000000000")
            //    {
            //        menus += "<td width=\"89\" height=\"23\" id=\"menu\" group=\"menu\" class=\"noclick\" onclick=\"chagemenu(this,'" + UserMenu.CL_Menu_SOID+ "')\" >" + UserMenu.MenuName + "</td><td>&nbsp;</td>";
            //    }
            //}
            //this.Literal1.Text= menus;
        }
    }
}